#include <stdio.h>
#define uch unsigned char
#define D_CODES 30
void printArray(int array[],int start,int end)
{
  int i;
  for (i = start;i<end;i++) {
    printf("%d\t",array[i]);
  }
  printf("\n__________________\n");
}

int main(int argc,char **argv)
{
  int code = 16;
  int dist = 256;
  dist = dist>>7;
  int base_dist[30] = {0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192};
  uch dist_code[512];
  int n;
  int extra_dbits[30] = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};

  for (;code<D_CODES;code++) {
    base_dist[code] = dist<<7;
    for (n = 0;n<(1<<(extra_dbits[code] - 7));n++) {
        dist_code[256 + dist++] = (uch)code;
    }
  }
  printArray(base_dist,0,30);
  return 0;
}
